<div class="modal" id="editModal">
	<div class="modal-dialog">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
          <h4 class="modal-title">Kategória módosítása</h4>
        </div>
		
        <div class="modal-body">
            <form role="form" action="/smaragd/admin/updatecategory" method="post" enctype="multipart/form-data">
            <div class="form-group">
			    <label for="productName">Kategória neve</label>
			    <input type="text" name="name" class="form-control" id="categoryEditName" required>
			</div>
			
			<input id="editCategoryID" name="id" style="display:none">
                <button id="submitEditCategoryModal" type="submit" class="btn btn-default" style="display:none">Submit</button>
            </form>
        </div>
		
        <div class="modal-footer">
            <a href="#" data-dismiss="modal" class="btn">Mégsem</a>
            <a href="#" class="btn btn-primary" onclick="$('#submitEditCategoryModal').click();">Módosít</a>
        </div>
      </div>
    </div>
</div>

<script>
$(document).on("click", ".edit-link", function () {
    var id = $(this).data('id');
    var name = $(this).data('categoryname');
    $('#editCategoryID').val(id);

    // prefill
    $('#categoryEditName').val(name);
});
</script>